from appium.webdriver.common.appiumby import  By

from pages.page01_index import app_index_page, app_search_page
from pages.page02_login import app_login_page
from tools import app_driver


def app_search_success():
    driver=app_driver()
    app_index_page(driver)
    app_login_page(driver,'15766666665','lhl123456')
    word='vivoX21'
    app_search_page(driver,word)
    result = driver.find_element(by=By.ID,value='com.tpshop.malls:id/product_name_tv').text
    assert word in result

if __name__ == '__main__':
    app_search_success()